//
//  HEHomeItemCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2021/5/24.
//  Copyright © 2021 honglutec. All rights reserved.
//

#import "HEHomeItemCell.h"


@interface HEHomeItemCell ()

@property (nonatomic, strong)  QMUIButton *itemBtn;

@end

@implementation HEHomeItemCell
 
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initUI];
    }
    return self;
}

- (void)initUI {
    _itemBtn = [[QMUIButton alloc] init];
    _itemBtn.imagePosition = QMUIButtonImagePositionTop;// 将图片位置改为在文字下方
    [_itemBtn setTitleColor:CNavBgColor forState:UIControlStateNormal];
    _itemBtn.imageEdgeInsets = UIEdgeInsetsMake(-10, 0, 0, 0);
    _itemBtn.backgroundColor = KHexColor(@"E9F1FD");
    _itemBtn.titleLabel.font = DYBlodFont(15);
    _itemBtn.userInteractionEnabled = NO;
    _itemBtn.layer.cornerRadius = 10;
    _itemBtn.layer.masksToBounds = YES;
    [self.contentView addSubview: _itemBtn];
    
    [_itemBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(0);
        make.left.equalTo(self.contentView).mas_offset(0);
        make.right.equalTo(self.contentView).mas_offset(-0);
        make.height.mas_offset(80);
        make.bottom.equalTo(self.contentView).mas_offset(-0);
    }];
}

- (void)configCellWithFiterModel:(GDFiterCellModel *)fiterModel indexPath:(NSIndexPath *)indexPath {
    NSDictionary *dict = (NSDictionary *)fiterModel.cellData;
    [_itemBtn setImage:UIImageMake(dict[@"icon"]) forState:UIControlStateNormal];
    [_itemBtn setTitle:dict[@"name"] forState:UIControlStateNormal];
}

@end

